import QtQuick 1.1
import com.nokia.meego 1.0

PageStackWindow {
    id: appWindow

    signal tryConnectDBus
    signal tryRunDaemon
    property bool statusConnectDBus: false

    property bool firstStart: true /* переменная для первого запуска программы */

    property string version: "0.7.x"

    showStatusBar: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? false : true

    UserTheme {
        id: mytheme
    }

    platformStyle: defaultStyle;
    PageStackWindowStyle { id: defaultStyle }
    PageStackWindowStyle {
        id: customStyle;
        background: "image://theme/meegotouch-wallpaper-portrait";
        backgroundFillMode: Image.PreserveAspectCrop
    }

    //initialPage: MainPage { }
    initialPage: Splash { }

    ToolBarLayout {
        id: tool_only_back
        visible: false
        ToolIcon { iconId: "toolbar-back"; onClicked: { pageStack.pop(); } }
    }

    Component.onCompleted: {
        /* светлая/темная темы */
        if( themeAppl === "light" ) {
            theme.inverted = false
        } else {
            theme.inverted = true
        }
    }

    function lockOrientation() {
        if( orientationAppl === "landscape" ) {
            return PageOrientation.LockLandscape
        } else if( orientationAppl === "portrait" ) {
            return PageOrientation.LockPortrait
        } else {
            return PageOrientation.Automatic
        }
    }

}
